package com.bhp.bhphrserver.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.bhp.bhphrserver.common.BaseEntity;
import lombok.Data;

import java.util.List;

/**
 * @ClassName Menu
 * @Description TODO
 * @Author 包海鹏
 * @Date 2020/4/29 15:00
 * @Version 1.0
 **/
@Data
@TableName(value = "menu")
public class Menu extends BaseEntity {

    /**
     * 主键
     */
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    /**
     * 请求路径规则
     */
    @TableField(value = "url")
    private String url;

    /**
     * 路由
     */
    @TableField(value = "path")
    private String path;

    /**
     * 组件名称
     */
    @TableField(value = "component")
    private String component;

    /**
     * 菜单名称
     */
    @TableField(value = "name")
    private String name;

    /**
     * 菜单图标
     */
    @TableField(value = "iconCls")
    private String iconCls;

    /**
     * 菜单切换是否保持存活
     */
    @TableField(value = "keepAlive")
    private boolean keepAlive;

    /**
     * 是否登录才能访问
     */
    @TableField(value = "requireAuth")
    private boolean requireAuth;

    /**
     * 父菜单ID
     */
    @TableField(value = "parentId")
    private String parentId;

    /**
     * 是否可用，默认可用
     */
    @TableField(value = "enabled")
    private boolean enabled;


    /**
     * 该资源对应的角色列表(排除字段映射)
     */
    @TableField(exist = false)
    private List<Role> roles;

}
